package com.easykoo.ioc.property;

import java.util.HashMap;
import java.util.Map;

import com.easykoo.ioc.BeanFactory;
import com.easykoo.ioc.Exception.BeanWireException;
import com.easykoo.ioc.Exception.NoSuchBeanException;

public class PropertyBeanFactory extends BeanFactory {

	public static BeanFactory propertyBeanFactory;
	private static Map<String, Object> entryMap;

	public static BeanFactory getInstance() {
		if (propertyBeanFactory == null) {
			propertyBeanFactory = new PropertyBeanFactory();
		}
		if (entryMap == null) {
			entryMap = new HashMap<String, Object>();
		}
		return propertyBeanFactory;
	}

	private PropertyBeanFactory() {
	}

	public Object getBean(String beanName) throws NoSuchBeanException, BeanWireException {
		return super.getBeanByName(beanName);
	}


	public Map<String, Object> getEntryMap() {
		return entryMap;
	}
	
	@Override
	public void push(Map<String, Object> map) {
		entryMap.putAll(map);
	}
	

}
